package io.yorkecao.sample.service;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Service;

/**
 * @author Yorke
 */
@Service
public class ShiroSampleService {

    @RequiresPermissions("read")
    public String read() {
        return "reading...";
    }

    @RequiresPermissions("write")
    public String write() {
        return "writing...";
    }

    @RequiresPermissions("remove")
    public String remove() {
        return "removing...";
    }

    @RequiresPermissions("patch")
    public String patch() {
        return "patching...";
    }

    @RequiresPermissions({"remove", "patch"})
    public String superWorker() {
        return "removing and patching...";
    }

    @RequiresPermissions({"read", "write"})
    public String host() {
        return "reading and writing...";
    }

    @RequiresPermissions({"read", "write", "patch", "remove"})
    public String god() {
        return "doing everything...";
    }

}
